package ks.client.controllers;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;

import javax.swing.JFrame;

import ks.client.UserContext;
import ks.client.controllers.commands.JoinCommandController;
import ks.client.controllers.commands.OptionsCommandController;
import ks.client.gui.GMGUI;
import ks.client.gui.GMTOPT;
import ks.client.gui.TMGUI;
import ks.client.ipc.*;
import ks.client.lobby.Lobby;
import ks.client.lobby.RoomGUI;
import ks.client.kommander.*;

import org.w3c.dom.Document;

import ks.framework.common.Message;
import ks.managers.table.Table;
import ks.managers.table.TableManager;
/**
 * Submits info to the server
 * 
 * @author szutshi
 */
public class SubmitInfoClick implements ActionListener{
	
	Lobby lobby;
	int num;
	
	/**
	 * @param lobby 
	 */
	public SubmitInfoClick(Lobby lobby, int num) {
		this.lobby = lobby;
		this.num = num;
		
	}
	
	public void actionPerformed(ActionEvent e){
		final int table = lobby.getTMGUI().Tables.getSelectedRow()+1;
		GMTOPT gui = lobby.getGMTOPT(num);
		TMGUI tgui = lobby.getTMGUI();
		gui.setVisible(false);
		gui.dispose();
		tgui.revalidate();
		
		
		new OptionsCommandController(lobby).send(table, table, null, false, false, 117, null, new Action() {
			public void ack() {
				
				
			}
			
			public void nack() {
				
			}
		});
	}
}